import {menu, permission} from '../src/mockData/index.js'

export default [
    {
        url: '/auth/login',
        method: 'get',
        response: (config) => {
            const {userid} = config.query// get用query，post用body
            return {
                code: 200,
                data: {
                    accessToken: `${userid}-accessToken`,
                    refreshToken: `${userid}-refreshToken`,
                    userid
                },
                msg: '成功。'
            }
        }
    },
    {
        url: '/auth/logout',
        method: 'get',
        response: (config) => {
            const {token} = config.query// get用query，post用body
            return {
                code: 200,
                data: {token},
                msg: '成功。'
            }
        }
    },
    {
        url: '/auth/auth/params/getLoginStyle',
        method: 'get',
        response: (config) => {
            console.log(config.query)
            return {
                code: 200,
                message: '成功。',
                data: {
                    result: 1
                }
            }
        }
    },
    {
        url: '/auth/menu',
        method: 'get',
        response: (config) => {
            console.log(config.query)
            return {
                code: 200,
                message: '成功。',
                data: {
                    result: {
                        listMainMenu: menu,
                        listPermission: permission
                    }
                }
            }
        }
    },
    {
        url: '/auth/sysdate',
        method: 'get',
        response: (config) => {
            console.log(config.query)
            return {
                'code': 200,
                'message': '成功。',
                'data': {
                    'result': new Date().getTime()
                }
            }
        }
    }
]
